package com.night.permManager.serviceImpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.night.common.entity.administration.Teacher;
import com.night.common.entity.role.Role;
import com.night.common.entity.student.Student;
import com.night.permManager.mapper.RoleMapper;
import com.night.permManager.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: RoleServiceImpl
 * @Description: //TODO
 * @author: dz
 * @date: 2022-08-31-14:35
 */
@Service("roleService")
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Autowired
    private RoleMapper roleMapper;
    @Override
    public Role getById(int id) {
        return roleMapper.getById(id);
    }

    @Override
    public List<Role> getRoles() {
        return roleMapper.getRoles();
    }

    @Override
    public Student getStudent(String studentNumber) {
        return roleMapper.getStudentByStudentNumber(studentNumber);
    }

    @Override
    public Teacher getTeacher(String teacherNumber) {
        return roleMapper.getStudentByTeacherNumber(teacherNumber);
    }
}
